package com.aiss.ws.fragment;


import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;

import org.androidannotations.annotations.EFragment;

/**
 * Created by chenqiang
 * 基类
 */
@EFragment
public class BaseFragment extends Fragment {

    private Handler handler = new Handler();


    private Toast toast;
    public void showMessage(final String content,final Context context){
        handler.post(new Runnable() {
            @Override
            public void run() {

                if(toast==null){
                    toast = Toast.makeText(context,content,Toast.LENGTH_SHORT);
                }else{
                    toast.cancel();
                    toast = Toast.makeText(context,content,Toast.LENGTH_SHORT);
                }
                toast.show();

            }
        });

    }


}
